package com.mkz.job.feign.factory;

import org.springframework.stereotype.Component;

import com.mkz.job.feign.JobinfoClient;
import com.mkz.job.feign.fallback.JobinfoServiceFallback;

import feign.hystrix.FallbackFactory;

/**
 * ClassName: JobinfoServiceFallbackFactory 
 * @Description: 动态创建/删除任务
 * @author: KuangJianyu
 * @date: 2020年4月17日
 */
@Component
public class JobinfoServiceFallbackFactory  implements FallbackFactory<JobinfoClient> {

	@Override
	public JobinfoClient create(Throwable throwable) {
		JobinfoServiceFallback jobinfoServiceFallback = new JobinfoServiceFallback();
		jobinfoServiceFallback.setCause(throwable);
		return jobinfoServiceFallback;
	}
}
